package com.ruoyi.flow.flow.identity.activiti.enums;

import com.ruoyi.flow.flow.identity.activiti.enums.Gender;

import javax.persistence.AttributeConverter;

/**
 * @author wtian
 * @version 1.0
 * @since 2018/9/5 13:01
 */
public class GenderConverter implements AttributeConverter<com.ruoyi.flow.flow.identity.activiti.enums.Gender, Integer> {
    @Override
    public Integer convertToDatabaseColumn(com.ruoyi.flow.flow.identity.activiti.enums.Gender gender) {
        return gender.getGender();
    }

    @Override
    public com.ruoyi.flow.flow.identity.activiti.enums.Gender convertToEntityAttribute(Integer integer) {
        return Gender.fromValue(integer);
    }
}
